#ifndef BITSTREAM_H_
#define BITSTREAM_H_

#include <stdint.h>

namespace opennav {

class BitstreamReader {
public:
	BitstreamReader(uint8_t* data, int32_t length);

	bool read_bit();
	uint32_t read(int32_t nBits);
	bool can_read(int32_t nBits) const;
	int32_t bits_remaining() const;

private:
	uint8_t* data_;
	int32_t length_;
	int32_t bitpos_;
};

}

#endif
